﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DLL;

namespace BLL
{
    public class UserService
    {
        private UserRepo m_Repo;

        public UserService()
        {
            m_Repo = new UserRepo();
        }

        public User Logon(string userName, string password, out bool logonSuccess)
        {
            return m_Repo.Logon(userName, password, out logonSuccess);
        }

        public bool ChangePassword(string userName, string newPassword, out string hashPassword)
        {
            return m_Repo.ChangePassword(userName, newPassword,  out hashPassword);
        }

        public User GetUserById(int userId)
        {
            return m_Repo.GetUserById(userId);
        }

        public void AddUser(User usr)
        {
            m_Repo.AddUser(usr);
        }

        public void DeleteUser(int userId)
        {
            m_Repo.DeleteUser(userId);
        }

        public void UpdateUser(User user)
        {
            m_Repo.UpdateUser(user);
        }

        public List<User> GetAllUsers()
        {
            return m_Repo.GetAllUsers();
        }

        public List<UserType> GetAllUserTypes()
        {
            return m_Repo.GetAllUserTypes();
        }
    }
}
